home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / Components.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  23.8 KB  |  651 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        Components.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1990-1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __COMPONENTS__
  18. #define __COMPONENTS__
  19.  
  20. #ifndef __MACERRORS__
  21.     #include <MacErrors.h>
  22. #endif
  23.  
  24. #ifndef __MACTYPES__
  25.     #include <MacTypes.h>
  26. #endif
  27.  
  28. #ifndef __MIXEDMODE__
  29.     #include <MixedMode.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. enum {
  56.     kAppleManufacturer            = FOUR_CHAR_CODE('appl'),        /* Apple supplied components */
  57.     kComponentResourceType        = FOUR_CHAR_CODE('thng'),        /* a components resource type */
  58.     kComponentAliasResourceType    = FOUR_CHAR_CODE('thga')        /* component alias resource type */
  59. };
  60.  
  61. enum {
  62.     kAnyComponentType            = 0,
  63.     kAnyComponentSubType        = 0,
  64.     kAnyComponentManufacturer    = 0,
  65.     kAnyComponentFlagsMask        = 0
  66. };
  67.  
  68. enum {
  69.     cmpIsMissing                = 1L << 29,
  70.     cmpWantsRegisterMessage        = 1L << 31
  71. };
  72.  
  73. enum {
  74.     kComponentOpenSelect        = -1,                            /* ComponentInstance for this open */
  75.     kComponentCloseSelect        = -2,                            /* ComponentInstance for this close */
  76.     kComponentCanDoSelect        = -3,                            /* selector # being queried */
  77.     kComponentVersionSelect        = -4,                            /* no params */
  78.     kComponentRegisterSelect    = -5,                            /* no params */
  79.     kComponentTargetSelect        = -6,                            /* ComponentInstance for top of call chain */
  80.     kComponentUnregisterSelect    = -7,                            /* no params */
  81.     kComponentGetMPWorkFunctionSelect = -8,                        /* some params */
  82.     kComponentExecuteWiredActionSelect = -9,                    /* QTAtomContainer actionContainer, QTAtom actionAtom, QTCustomActionTargetPtr target, QTEventRecordPtr event */
  83.     kComponentGetPublicResourceSelect = -10                        /* OSType resourceType, short resourceId, Handle *resource */
  84. };
  85.  
  86. /* Component Resource Extension flags */
  87. enum {
  88.     componentDoAutoVersion        = (1 << 0),
  89.     componentWantsUnregister    = (1 << 1),
  90.     componentAutoVersionIncludeFlags = (1 << 2),
  91.     componentHasMultiplePlatforms = (1 << 3),
  92.     componentLoadResident        = (1 << 4)
  93. };
  94.  
  95.  
  96.  
  97. /* Set Default Component flags */
  98. enum {
  99.     defaultComponentIdentical    = 0,
  100.     defaultComponentAnyFlags    = 1,
  101.     defaultComponentAnyManufacturer = 2,
  102.     defaultComponentAnySubType    = 4,
  103.     defaultComponentAnyFlagsAnyManufacturer = (defaultComponentAnyFlags + defaultComponentAnyManufacturer),
  104.     defaultComponentAnyFlagsAnyManufacturerAnySubType = (defaultComponentAnyFlags + defaultComponentAnyManufacturer + defaultComponentAnySubType)
  105. };
  106.  
  107. /* RegisterComponentResource flags */
  108. enum {
  109.     registerComponentGlobal        = 1,
  110.     registerComponentNoDuplicates = 2,
  111.     registerComponentAfterExisting = 4,
  112.     registerComponentAliasesOnly = 8
  113. };
  114.  
  115.  
  116.  
  117. struct ComponentDescription {
  118.     OSType                             componentType;                /* A unique 4-byte code indentifying the command set */
  119.     OSType                             componentSubType;            /* Particular flavor of this instance */
  120.     OSType                             componentManufacturer;        /* Vendor indentification */
  121.     unsigned long                     componentFlags;                /* 8 each for Component,Type,SubType,Manuf/revision */
  122.     unsigned long                     componentFlagsMask;            /* Mask for specifying which flags to consider in search, zero during registration */
  123. };
  124. typedef struct ComponentDescription        ComponentDescription;
  125.  
  126.  
  127. struct ResourceSpec {
  128.     OSType                             resType;                    /* 4-byte code     */
  129.     short                             resID;                        /*              */
  130. };
  131. typedef struct ResourceSpec                ResourceSpec;
  132.  
  133. struct ComponentResource {
  134.     ComponentDescription             cd;                            /* Registration parameters */
  135.     ResourceSpec                     component;                    /* resource where Component code is found */
  136.     ResourceSpec                     componentName;                /* name string resource */
  137.     ResourceSpec                     componentInfo;                /* info string resource */
  138.     ResourceSpec                     componentIcon;                /* icon resource */
  139. };
  140. typedef struct ComponentResource        ComponentResource;
  141. typedef ComponentResource *                ComponentResourcePtr;
  142. typedef ComponentResourcePtr *            ComponentResourceHandle;
  143.  
  144. struct ComponentPlatformInfo {
  145.     long                             componentFlags;                /* flags of Component */
  146.     ResourceSpec                     component;                    /* resource where Component code is found */
  147.     short                             platformType;                /* gestaltSysArchitecture result */
  148. };
  149. typedef struct ComponentPlatformInfo    ComponentPlatformInfo;
  150.  
  151. struct ComponentResourceExtension {
  152.     long                             componentVersion;            /* version of Component */
  153.     long                             componentRegisterFlags;        /* flags for registration */
  154.     short                             componentIconFamily;        /* resource id of Icon Family */
  155. };
  156. typedef struct ComponentResourceExtension ComponentResourceExtension;
  157.  
  158. struct ComponentPlatformInfoArray {
  159.     long                             count;
  160.     ComponentPlatformInfo             platformArray[1];
  161. };
  162. typedef struct ComponentPlatformInfoArray ComponentPlatformInfoArray;
  163.  
  164. struct ExtComponentResource {
  165.     ComponentDescription             cd;                            /* registration parameters */
  166.     ResourceSpec                     component;                    /* resource where Component code is found */
  167.     ResourceSpec                     componentName;                /* name string resource */
  168.     ResourceSpec                     componentInfo;                /* info string resource */
  169.     ResourceSpec                     componentIcon;                /* icon resource */
  170.     long                             componentVersion;            /* version of Component */
  171.     long                             componentRegisterFlags;        /* flags for registration */
  172.     short                             componentIconFamily;        /* resource id of Icon Family */
  173.     long                             count;                        /* elements in platformArray */
  174.     ComponentPlatformInfo             platformArray[1];
  175. };
  176. typedef struct ExtComponentResource        ExtComponentResource;
  177. typedef ExtComponentResource *            ExtComponentResourcePtr;
  178. typedef ExtComponentResourcePtr *        ExtComponentResourceHandle;
  179.  
  180. struct ComponentAliasResource {
  181.     ComponentResource                 cr;                            /* Registration parameters */
  182.     ComponentDescription             aliasCD;                    /* component alias description */
  183. };
  184. typedef struct ComponentAliasResource    ComponentAliasResource;
  185. /*  Structure received by Component:        */
  186.  
  187. struct ComponentParameters {
  188.     UInt8                             flags;                        /* call modifiers: sync/async, deferred, immed, etc */
  189.     UInt8                             paramSize;                    /* size in bytes of actual parameters passed to this call */
  190.     short                             what;                        /* routine selector, negative for Component management calls */
  191.     long                             params[1];                    /* actual parameters for the indicated routine */
  192. };
  193. typedef struct ComponentParameters        ComponentParameters;
  194.  
  195. struct ComponentRecord {
  196.     long                             data[1];
  197. };
  198. typedef struct ComponentRecord            ComponentRecord;
  199.  
  200. typedef ComponentRecord *                Component;
  201.  
  202. struct ComponentInstanceRecord {
  203.     long                             data[1];
  204. };
  205. typedef struct ComponentInstanceRecord    ComponentInstanceRecord;
  206.  
  207. typedef ComponentInstanceRecord *        ComponentInstance;
  208.  
  209. struct RegisteredComponentRecord {
  210.     long                             data[1];
  211. };
  212. typedef struct RegisteredComponentRecord RegisteredComponentRecord;
  213. typedef RegisteredComponentRecord *        RegisteredComponentRecordPtr;
  214.  
  215. typedef RegisteredComponentRecord *        RegisteredComponentPtr;
  216.  
  217. struct RegisteredComponentInstanceRecord {
  218.     long                             data[1];
  219. };
  220. typedef struct RegisteredComponentInstanceRecord RegisteredComponentInstanceRecord;
  221. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr;
  222.  
  223. typedef RegisteredComponentInstanceRecord * RegisteredComponentInstancePtr;
  224. typedef long                             ComponentResult;
  225. enum {
  226.     platform68k                    = 1,                            /* platform type (response from gestaltSysArchitecture) */
  227.     platformPowerPC                = 2,
  228.     platformInterpreted            = 3,
  229.     platformWin32                = 4
  230. };
  231.  
  232. enum {
  233.     mpWorkFlagDoWork            = (1 << 0),
  234.     mpWorkFlagDoCompletion        = (1 << 1),
  235.     mpWorkFlagCopyWorkBlock        = (1 << 2),
  236.     mpWorkFlagDontBlock            = (1 << 3),
  237.     mpWorkFlagGetProcessorCount    = (1 << 4),
  238.     mpWorkFlagGetIsRunning        = (1 << 6)
  239. };
  240.  
  241. enum {
  242.     cmpAliasNoFlags                = 0,
  243.     cmpAliasOnlyThisFile        = 1
  244. };
  245.  
  246.  
  247. struct ComponentMPWorkFunctionHeaderRecord {
  248.     UInt32                             headerSize;
  249.     UInt32                             recordSize;
  250.     UInt32                             workFlags;
  251.     UInt16                             processorCount;
  252.     UInt8                             unused;
  253.     UInt8                             isRunning;
  254. };
  255. typedef struct ComponentMPWorkFunctionHeaderRecord ComponentMPWorkFunctionHeaderRecord;
  256. typedef ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr;
  257. typedef CALLBACK_API( ComponentResult , ComponentMPWorkFunctionProcPtr )(void *globalRefCon, ComponentMPWorkFunctionHeaderRecordPtr header);
  258. typedef CALLBACK_API( ComponentResult , ComponentRoutineProcPtr )(ComponentParameters *cp, Handle componentStorage);
  259. typedef CALLBACK_API( OSErr , GetMissingComponentResourceProcPtr )(Component c, OSType resType, short resID, void *refCon, Handle *resource);
  260. typedef STACK_UPP_TYPE(ComponentMPWorkFunctionProcPtr)             ComponentMPWorkFunctionUPP;
  261. typedef STACK_UPP_TYPE(ComponentRoutineProcPtr)                 ComponentRoutineUPP;
  262. typedef STACK_UPP_TYPE(GetMissingComponentResourceProcPtr)         GetMissingComponentResourceUPP;
  263. /*
  264.     The parameter list for each ComponentFunction is unique. It is 
  265.     therefore up to users to create the appropriate procInfo for their 
  266.     own ComponentFunctions where necessary.
  267. */
  268.  
  269. typedef UniversalProcPtr                 ComponentFunctionUPP;
  270. #if TARGET_RT_MAC_CFM
  271. /* 
  272.     CallComponentUPP is a global variable exported from InterfaceLib.
  273.     It is the ProcPtr passed to CallUniversalProc to manually call a component function.
  274. */
  275. extern UniversalProcPtr CallComponentUPP;
  276. #endif
  277.  
  278. #define ComponentCallNow( callNumber, paramSize ) \
  279.     FIVEWORDINLINE( 0x2F3C,paramSize,callNumber,0x7000,0xA82A )
  280.  
  281. /********************************************************
  282. *                                                        *
  283. *                  APPLICATION LEVEL CALLS                    *
  284. *                                                        *
  285. ********************************************************/
  286. /********************************************************
  287. * Component Database Add, Delete, and Query Routines 
  288. ********************************************************/
  289. EXTERN_API( Component )
  290. RegisterComponent                (ComponentDescription *    cd,
  291.                                  ComponentRoutineUPP     componentEntryPoint,
  292.                                  short                     global,
  293.                                  Handle                 componentName,
  294.                                  Handle                 componentInfo,
  295.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7001, 0xA82A);
  296.  
  297. EXTERN_API( Component )
  298. RegisterComponentResource        (ComponentResourceHandle  cr,
  299.                                  short                     global)                                TWOWORDINLINE(0x7012, 0xA82A);
  300.  
  301. EXTERN_API( OSErr )
  302. UnregisterComponent                (Component                 aComponent)                            TWOWORDINLINE(0x7002, 0xA82A);
  303.  
  304. EXTERN_API( Component )
  305. FindNextComponent                (Component                 aComponent,
  306.                                  ComponentDescription *    looking)                            TWOWORDINLINE(0x7004, 0xA82A);
  307.  
  308. EXTERN_API( long )
  309. CountComponents                    (ComponentDescription *    looking)                            TWOWORDINLINE(0x7003, 0xA82A);
  310.  
  311. EXTERN_API( OSErr )
  312. GetComponentInfo                (Component                 aComponent,
  313.                                  ComponentDescription *    cd,
  314.                                  Handle                 componentName,
  315.                                  Handle                 componentInfo,
  316.                                  Handle                 componentIcon)                        TWOWORDINLINE(0x7005, 0xA82A);
  317.  
  318. EXTERN_API( long )
  319. GetComponentListModSeed            (void)                                                        TWOWORDINLINE(0x7006, 0xA82A);
  320.  
  321. EXTERN_API( long )
  322. GetComponentTypeModSeed            (OSType                 componentType)                        TWOWORDINLINE(0x702C, 0xA82A);
  323.  
  324. /********************************************************
  325. * Component Instance Allocation and dispatch routines 
  326. ********************************************************/
  327. EXTERN_API( OSErr )
  328. OpenAComponent                    (Component                 aComponent,
  329.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702D, 0xA82A);
  330.  
  331. EXTERN_API( ComponentInstance )
  332. OpenComponent                    (Component                 aComponent)                            TWOWORDINLINE(0x7007, 0xA82A);
  333.  
  334. EXTERN_API( OSErr )
  335. CloseComponent                    (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x7008, 0xA82A);
  336.  
  337. EXTERN_API( OSErr )
  338. GetComponentInstanceError        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700A, 0xA82A);
  339.  
  340. /********************************************************
  341. *                                                        *
  342. *                      CALLS MADE BY COMPONENTS              *
  343. *                                                        *
  344. ********************************************************/
  345. /********************************************************
  346. * Component Management routines
  347. ********************************************************/
  348. EXTERN_API( void )
  349. SetComponentInstanceError        (ComponentInstance         aComponentInstance,
  350.                                  OSErr                     theError)                            TWOWORDINLINE(0x700B, 0xA82A);
  351.  
  352. EXTERN_API( long )
  353. GetComponentRefcon                (Component                 aComponent)                            TWOWORDINLINE(0x7010, 0xA82A);
  354.  
  355. EXTERN_API( void )
  356. SetComponentRefcon                (Component                 aComponent,
  357.                                  long                     theRefcon)                            TWOWORDINLINE(0x7011, 0xA82A);
  358.  
  359. EXTERN_API( short )
  360. OpenComponentResFile            (Component                 aComponent)                            TWOWORDINLINE(0x7015, 0xA82A);
  361.  
  362. EXTERN_API( OSErr )
  363. OpenAComponentResFile            (Component                 aComponent,
  364.                                  short *                resRef)                                TWOWORDINLINE(0x702F, 0xA82A);
  365.  
  366. EXTERN_API( OSErr )
  367. CloseComponentResFile            (short                     refnum)                                TWOWORDINLINE(0x7018, 0xA82A);
  368.  
  369. EXTERN_API( OSErr )
  370. GetComponentResource            (Component                 aComponent,
  371.                                  OSType                 resType,
  372.                                  short                     resID,
  373.                                  Handle *                theResource)                        TWOWORDINLINE(0x7035, 0xA82A);
  374.  
  375. EXTERN_API( OSErr )
  376. GetComponentIndString            (Component                 aComponent,
  377.                                  Str255                 theString,
  378.                                  short                     strListID,
  379.                                  short                     index)                                TWOWORDINLINE(0x7036, 0xA82A);
  380.  
  381. EXTERN_API( OSErr )
  382. GetComponentPublicResource        (Component                 aComponent,
  383.                                  OSType                 resourceType,
  384.                                  short                     resourceID,
  385.                                  Handle *                theResource)                        TWOWORDINLINE(0x7038, 0xA82A);
  386.  
  387. EXTERN_API( OSErr )
  388. GetComponentPublicResourceList    (OSType                 resourceType,
  389.                                  short                     resourceID,
  390.                                  long                     flags,
  391.                                  ComponentDescription *    cd,
  392.                                  GetMissingComponentResourceUPP  missingProc,
  393.                                  void *                    refCon,
  394.                                  void *                    atomContainerPtr)                    TWOWORDINLINE(0x7039, 0xA82A);
  395.  
  396. EXTERN_API( Component )
  397. ResolveComponentAlias            (Component                 aComponent)                            TWOWORDINLINE(0x7020, 0xA82A);
  398.  
  399. EXTERN_API( OSErr )
  400. GetComponentPublicIndString        (Component                 aComponent,
  401.                                  Str255                 theString,
  402.                                  short                     strListID,
  403.                                  short                     index)                                TWOWORDINLINE(0x703A, 0xA82A);
  404.  
  405.  
  406. /********************************************************
  407. * Component Instance Management routines
  408. ********************************************************/
  409. EXTERN_API( Handle )
  410. GetComponentInstanceStorage        (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700C, 0xA82A);
  411.  
  412. EXTERN_API( void )
  413. SetComponentInstanceStorage        (ComponentInstance         aComponentInstance,
  414.                                  Handle                 theStorage)                            TWOWORDINLINE(0x700D, 0xA82A);
  415.  
  416. EXTERN_API( long )
  417. GetComponentInstanceA5            (ComponentInstance         aComponentInstance)                    TWOWORDINLINE(0x700E, 0xA82A);
  418.  
  419. EXTERN_API( void )
  420. SetComponentInstanceA5            (ComponentInstance         aComponentInstance,
  421.                                  long                     theA5)                                TWOWORDINLINE(0x700F, 0xA82A);
  422.  
  423. EXTERN_API( long )
  424. CountComponentInstances            (Component                 aComponent)                            TWOWORDINLINE(0x7013, 0xA82A);
  425.  
  426. /* useful helper routines for convenient method dispatching */
  427. EXTERN_API( long )
  428. CallComponentFunction            (ComponentParameters *    params,
  429.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  430.  
  431. EXTERN_API( long )
  432. CallComponentFunctionWithStorage (Handle                 storage,
  433.                                  ComponentParameters *    params,
  434.                                  ComponentFunctionUPP     func)                                TWOWORDINLINE(0x70FF, 0xA82A);
  435.  
  436. #if TARGET_CPU_PPC && TARGET_OS_MAC
  437. EXTERN_API( long )
  438. CallComponentFunctionWithStorageProcInfo (Handle         storage,
  439.                                  ComponentParameters *    params,
  440.                                  ProcPtr                 func,
  441.                                  ProcInfoType             funcProcInfo);
  442.  
  443. #else
  444. #define CallComponentFunctionWithStorageProcInfo(storage, params, func, funcProcInfo ) CallComponentFunctionWithStorage(storage, params, func)
  445.  
  446. #endif  /* TARGET_CPU_PPC && TARGET_OS_MAC */
  447.  
  448. EXTERN_API( long )
  449. DelegateComponentCall            (ComponentParameters *    originalParams,
  450.                                  ComponentInstance         ci)                                    TWOWORDINLINE(0x7024, 0xA82A);
  451.  
  452. EXTERN_API( OSErr )
  453. SetDefaultComponent                (Component                 aComponent,
  454.                                  short                     flags)                                TWOWORDINLINE(0x701E, 0xA82A);
  455.  
  456. EXTERN_API( ComponentInstance )
  457. OpenDefaultComponent            (OSType                 componentType,
  458.                                  OSType                 componentSubType)                    TWOWORDINLINE(0x7021, 0xA82A);
  459.  
  460. EXTERN_API( OSErr )
  461. OpenADefaultComponent            (OSType                 componentType,
  462.                                  OSType                 componentSubType,
  463.                                  ComponentInstance *    ci)                                    TWOWORDINLINE(0x702E, 0xA82A);
  464.  
  465. EXTERN_API( Component )
  466. CaptureComponent                (Component                 capturedComponent,
  467.                                  Component                 capturingComponent)                    TWOWORDINLINE(0x701C, 0xA82A);
  468.  
  469. EXTERN_API( OSErr )
  470. UncaptureComponent                (Component                 aComponent)                            TWOWORDINLINE(0x701D, 0xA82A);
  471.  
  472. EXTERN_API( long )
  473. RegisterComponentResourceFile    (short                     resRefNum,
  474.                                  short                     global)                                TWOWORDINLINE(0x7014, 0xA82A);
  475.  
  476. EXTERN_API( OSErr )
  477. GetComponentIconSuite            (Component                 aComponent,
  478.                                  Handle *                iconSuite)                            TWOWORDINLINE(0x7029, 0xA82A);
  479.  
  480.  
  481. /********************************************************
  482. *                                                        *
  483. *              Direct calls to the Components                *
  484. *                                                        *
  485. ********************************************************/
  486. /* Old style names*/
  487.  
  488. EXTERN_API( long )
  489. ComponentFunctionImplemented    (ComponentInstance         ci,
  490.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  491.  
  492. EXTERN_API( long )
  493. GetComponentVersion                (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  494.  
  495. EXTERN_API( long )
  496. ComponentSetTarget                (ComponentInstance         ci,
  497.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  498.  
  499. /* New style names*/
  500.  
  501. EXTERN_API( ComponentResult )
  502. CallComponentOpen                (ComponentInstance         ci,
  503.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFF, 0x7000, 0xA82A);
  504.  
  505. EXTERN_API( ComponentResult )
  506. CallComponentClose                (ComponentInstance         ci,
  507.                                  ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFE, 0x7000, 0xA82A);
  508.  
  509. EXTERN_API( ComponentResult )
  510. CallComponentCanDo                (ComponentInstance         ci,
  511.                                  short                     ftnNumber)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0xFFFD, 0x7000, 0xA82A);
  512.  
  513. EXTERN_API( ComponentResult )
  514. CallComponentVersion            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFC, 0x7000, 0xA82A);
  515.  
  516. EXTERN_API( ComponentResult )
  517. CallComponentRegister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFFB, 0x7000, 0xA82A);
  518.  
  519. EXTERN_API( ComponentResult )
  520. CallComponentTarget                (ComponentInstance         ci,
  521.                                  ComponentInstance         target)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0xFFFA, 0x7000, 0xA82A);
  522.  
  523. EXTERN_API( ComponentResult )
  524. CallComponentUnregister            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0xFFF9, 0x7000, 0xA82A);
  525.  
  526. EXTERN_API( ComponentResult )
  527. CallComponentGetMPWorkFunction    (ComponentInstance         ci,
  528.                                  ComponentMPWorkFunctionUPP * workFunction,
  529.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0xFFF8, 0x7000, 0xA82A);
  530.  
  531. EXTERN_API( ComponentResult )
  532. CallComponentGetPublicResource    (ComponentInstance         ci,
  533.                                  OSType                 resourceType,
  534.                                  short                     resourceID,
  535.                                  Handle *                resource)                            FIVEWORDINLINE(0x2F3C, 0x000A, 0xFFF6, 0x7000, 0xA82A);
  536.  
  537.  
  538. #if !TARGET_OS_MAC
  539. /* 
  540.         CallComponent is used by ComponentGlue routines to manually call a component function.
  541.      */
  542. EXTERN_API( ComponentResult )
  543. CallComponent                    (ComponentInstance         ci,
  544.                                  ComponentParameters *    cp);
  545.  
  546. #endif  /* !TARGET_OS_MAC */
  547.  
  548. /* UPP call backs */
  549. #if OPAQUE_UPP_TYPES
  550.     EXTERN_API(ComponentMPWorkFunctionUPP)
  551.     NewComponentMPWorkFunctionUPP    (ComponentMPWorkFunctionProcPtr userRoutine);
  552.  
  553.     EXTERN_API(ComponentRoutineUPP)
  554.     NewComponentRoutineUPP           (ComponentRoutineProcPtr    userRoutine);
  555.  
  556.     EXTERN_API(GetMissingComponentResourceUPP)
  557.     NewGetMissingComponentResourceUPP    (GetMissingComponentResourceProcPtr userRoutine);
  558.  
  559.     EXTERN_API(void)
  560.     DisposeComponentMPWorkFunctionUPP    (ComponentMPWorkFunctionUPP userUPP);
  561.  
  562.     EXTERN_API(void)
  563.     DisposeComponentRoutineUPP       (ComponentRoutineUPP        userUPP);
  564.  
  565.     EXTERN_API(void)
  566.     DisposeGetMissingComponentResourceUPP    (GetMissingComponentResourceUPP userUPP);
  567.  
  568.     EXTERN_API(ComponentResult)
  569.     InvokeComponentMPWorkFunctionUPP    (void *                globalRefCon,
  570.                                     ComponentMPWorkFunctionHeaderRecordPtr header,
  571.                                     ComponentMPWorkFunctionUPP userUPP);
  572.  
  573.     EXTERN_API(ComponentResult)
  574.     InvokeComponentRoutineUPP       (ComponentParameters *    cp,
  575.                                     Handle                    componentStorage,
  576.                                     ComponentRoutineUPP        userUPP);
  577.  
  578.     EXTERN_API(OSErr)
  579.     InvokeGetMissingComponentResourceUPP    (Component        c,
  580.                                     OSType                    resType,
  581.                                     short                    resID,
  582.                                     void *                    refCon,
  583.                                     Handle *                resource,
  584.                                     GetMissingComponentResourceUPP userUPP);
  585.  
  586. #else
  587.     enum { uppComponentMPWorkFunctionProcInfo = 0x000003F0 };         /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  588.     enum { uppComponentRoutineProcInfo = 0x000003F0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  589.     enum { uppGetMissingComponentResourceProcInfo = 0x0000FBE0 };     /* pascal 2_bytes Func(4_bytes, 4_bytes, 2_bytes, 4_bytes, 4_bytes) */
  590.     #define NewComponentMPWorkFunctionUPP(userRoutine)                 (ComponentMPWorkFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentMPWorkFunctionProcInfo, GetCurrentArchitecture())
  591.     #define NewComponentRoutineUPP(userRoutine)                     (ComponentRoutineUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppComponentRoutineProcInfo, GetCurrentArchitecture())
  592.     #define NewGetMissingComponentResourceUPP(userRoutine)             (GetMissingComponentResourceUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetMissingComponentResourceProcInfo, GetCurrentArchitecture())
  593.     #define DisposeComponentMPWorkFunctionUPP(userUPP)                 DisposeRoutineDescriptor(userUPP)
  594.     #define DisposeComponentRoutineUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  595.     #define DisposeGetMissingComponentResourceUPP(userUPP)             DisposeRoutineDescriptor(userUPP)
  596.     #define InvokeComponentMPWorkFunctionUPP(globalRefCon, header, userUPP)  (ComponentResult)CALL_TWO_PARAMETER_UPP((userUPP), uppComponentMPWorkFunctionProcInfo, (globalRefCon), (header))
  597.     #define InvokeComponentRoutineUPP(cp, componentStorage, userUPP)  (ComponentResult)CALL_TWO_PARAMETER_UPP((userUPP), uppComponentRoutineProcInfo, (cp), (componentStorage))
  598.     #define InvokeGetMissingComponentResourceUPP(c, resType, resID, refCon, resource, userUPP)  (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppGetMissingComponentResourceProcInfo, (c), (resType), (resID), (refCon), (resource))
  599. #endif
  600. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  601. #define NewComponentMPWorkFunctionProc(userRoutine)             NewComponentMPWorkFunctionUPP(userRoutine)
  602. #define NewComponentRoutineProc(userRoutine)                     NewComponentRoutineUPP(userRoutine)
  603. #define NewGetMissingComponentResourceProc(userRoutine)         NewGetMissingComponentResourceUPP(userRoutine)
  604. #define CallComponentMPWorkFunctionProc(userRoutine, globalRefCon, header) InvokeComponentMPWorkFunctionUPP(globalRefCon, header, userRoutine)
  605. #define CallComponentRoutineProc(userRoutine, cp, componentStorage) InvokeComponentRoutineUPP(cp, componentStorage, userRoutine)
  606. #define CallGetMissingComponentResourceProc(userRoutine, c, resType, resID, refCon, resource) InvokeGetMissingComponentResourceUPP(c, resType, resID, refCon, resource, userRoutine)
  607. /* ProcInfos */
  608.  
  609. /* MixedMode ProcInfo constants for component calls */
  610. enum {
  611.     uppComponentFunctionImplementedProcInfo            = 0x000002F0,
  612.     uppGetComponentVersionProcInfo                    = 0x000000F0,
  613.     uppComponentSetTargetProcInfo                    = 0x000003F0,
  614.     uppCallComponentOpenProcInfo                    = 0x000003F0,
  615.     uppCallComponentCloseProcInfo                    = 0x000003F0,
  616.     uppCallComponentCanDoProcInfo                    = 0x000002F0,
  617.     uppCallComponentVersionProcInfo                    = 0x000000F0,
  618.     uppCallComponentRegisterProcInfo                = 0x000000F0,
  619.     uppCallComponentTargetProcInfo                    = 0x000003F0,
  620.     uppCallComponentUnregisterProcInfo                = 0x000000F0,
  621.     uppCallComponentGetMPWorkFunctionProcInfo        = 0x00000FF0,
  622.     uppCallComponentGetPublicResourceProcInfo        = 0x00003BF0
  623. };
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631. #if PRAGMA_STRUCT_ALIGN
  632.     #pragma options align=reset
  633. #elif PRAGMA_STRUCT_PACKPUSH
  634.     #pragma pack(pop)
  635. #elif PRAGMA_STRUCT_PACK
  636.     #pragma pack()
  637. #endif
  638.  
  639. #ifdef PRAGMA_IMPORT_OFF
  640. #pragma import off
  641. #elif PRAGMA_IMPORT
  642. #pragma import reset
  643. #endif
  644.  
  645. #ifdef __cplusplus
  646. }
  647. #endif
  648.  
  649. #endif /* __COMPONENTS__ */
  650.  
  651.